package year2022.month123;

import java.util.concurrent.locks.ReentrantLock;

public class LockTest {
    public static void main(String[] args) throws InterruptedException {

        ReentrantLock lock = new ReentrantLock();

        lock.lock();
        lock.tryLock();

        Obj obj = new Obj();

        Thread[] tArr = new Thread[10];
        for (int i=0; i<tArr.length; i++){
            tArr[i] = new Thread(new MyInit(obj));
            tArr[i].start();
        }
    }
}
